#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QtGui/QPushButton>
#include <QtGui>
#include "ftdi/ftspi.h"
#include "qhexedit/qhexedit.h"
#include "ftdi/diodorspi.h"

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    MainWindow(QByteArray *filename);
    ~MainWindow();
    void fileProcess(QByteArray* openFileName);

    QByteArray *argFileName;

private:
//gui block
    Ui::MainWindow *ui;
    QHexEdit *hexeditProgram;
    QHexEdit *hexeditData;
    QTimer *timer;

//spi block
    FtSpi *spi;


//diodor block
    DiodorSpi *diodorSpi;
    QByteArray *data;
    QFile *dataFile;
    //unsigned int bytes;

public slots:
    void startProcessClicked();
    void fileOpen();
    void fileSave();
private slots:
    void on_pushButton_clicked();
    void on_buttonSetDirection_clicked();
    void on_buttonSetState_clicked();
    void on_buttonReadValue_clicked();
    void on_buttonSend_clicked();
    void on_buttonStrobCS_clicked();
};

#endif // MAINWINDOW_H
